With class-wide types, assignments are not just compatible or not. Rather, there are three states of assignment compatibility:

definite
assignment is always possible

potential
compatibility depends on the actual type of the assigned expression

incompatible
assignment is never possible


With the previous declarations, the following assignment rules can be stated:

  • If the type of an expression to be assigned is a class-wide type, take its actual type as its type.

  • Equal types are definitely compatible.

  • To a class-wide type all derived types can definitely be assigned.